package com.sec.android.app.myfiles.module.local.file;

import android.provider.MediaStore;

import com.sec.android.app.myfiles.provider.DbTableInfo;

public class LocalFileDbTableInfo extends DbTableInfo {

    private static LocalFileDbTableInfo mInstance = null;

    public static DbTableInfo getInstance() {
        if (mInstance == null) {
            mInstance = new LocalFileDbTableInfo();
        }

        return mInstance;

    }

    protected LocalFileDbTableInfo() {
        mTableColumn.add(new DB_Column(COLUMN_ID.ID, "_id", "integer PRIMARY KEY"));
        mTableColumn.add(new DB_Column(COLUMN_ID.MEDIA_ID, "media_id", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.PATH, "path", "text COLLATE NOCASE"));
        mTableColumn.add(new DB_Column(COLUMN_ID.NAME, "name", "text COLLATE NOCASE"));
        mTableColumn.add(new DB_Column(COLUMN_ID.SIZE, "size", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DATE, "date", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.FILE_TYPE, "file_type", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.EXT, "ext", "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.IS_DIRECTORY, "isDirectory", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.IS_HIDDEN, "is_hidden", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.ITEM_COUNT, "item_count", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.ITEM_COUNT_HIDDEN, "item_count_hidden", "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.IS_360_CONTENTS, "is_360_contents", "integer"));

        mTableColumn.add(new DB_Column(COLUMN_ID.WIDTH, MediaStore.Files.FileColumns.WIDTH, "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.HEIGHT, MediaStore.Files.FileColumns.HEIGHT, "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.DURATION, MediaStore.Video.VideoColumns.DURATION, "integer"));
        mTableColumn.add(new DB_Column(COLUMN_ID.ARTIST, MediaStore.Audio.AlbumColumns.ARTIST, "text"));
        mTableColumn.add(new DB_Column(COLUMN_ID.ALBUM, MediaStore.Audio.AlbumColumns.ALBUM, "integer"));
    }

    @Override
    public String getTableName() {
        final String tableName = "local_files";
        return tableName;
    }

    @Override
    public boolean isRealDb() {
        return true;
    }

}
